{% extends 'reports.html' %}

{% block header %}Reports: Most often reserved books{% endblock %}

{% block report %}
<form action="." method="POST">
    {% include "reports/date_controls.html" %}

    <div style='margin-top: 1em'>
            <table class="booklist">
              <thead>
                <tr>
                    <th>Title
                      <input type="submit" name="btn_sort_title" value="^" title="Ascending"/>
                      <input type="submit" name="btn_sort_-title" value="v" title="Descending"/></th>
                    <th>Number of reservations
                      <input type="submit" name="btn_sort_num_rsvs" value="^" title="Ascending"/>
                      <input type="submit" name="btn_sort_-num_rsvs" value="v" title="Descending"/></th>
                </tr>
              </thead>
              <tbody>
                {% for book in report %}
                <tr>
                    <td>{{ book.title }}</td>
                    <td>{{ book.num_of_reservations }}</td>
                </tr>
                {% endfor %}
              </tbody>
            </table>
    </div>
</form>
{% endblock %}
